<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>JQ_模态框</title>
        <script src="jquery.min.js"></script>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            .out_box{
                width: 1000px;
                height: 500px;
                background-color: rgb(213, 206, 206);
                padding-top: 100px;
                margin: 0 auto;

            }
            .picture{
                width: 1000px;
                height: 400px;
                margin: 0 auto;
                background-color: #5F0101;
                border-radius: 20px;
            }
            .left{
                width: 700px;
                height: 400px;
                border-radius: 20px;
                background-image: url("1.png");
                float: left;
            }
            .right{
                width: 200px;
                height: 200px;
                border-radius: 20px;
                float: left;
                margin-top: 200px;
            }
            .btn_box>a{
                display: inline-block;
                width: 200px;
                height: 40px;
                line-height: 40px;
                margin-top: 20px;
                text-align: center;
                border-radius: 20px;
                font-family: 楷体;
                font-size: 20px;
                border: none;
                margin: 0 auto;
            }
            #mtk {
                width: 1000px;
                height: 350px;
                border-radius: 20px;
                padding-top: 50px;
            }
            #mtk_nr{
                width: 350px;
                height: 200px;
                border-radius: 20px;
                background-color: #f3f3f3;
                margin: 0 auto;
                display: none;
            }
            #mtk_nr>input{
                width: 200px;
                height: 30px;
                display: inline-block;
                border: none;
                border-radius: 15px;
                margin-top:45px;
                margin-left:75px;
            }
        </style>
    </head>
    <body>
        <div class="out_box">
            <div class="picture">
                <div class="left">
                    <div id="mtk">
                        <div id="mtk_nr">
                            <input placeholder=" 请输入用户名" >
                            <input placeholder=" 请输入密码">
                        </div>
                    </div>
                </div>
                <div class="right">
                    <div class="btn_box">
                        <a id="btn1" style="background-color: #18B4ED;" href="#">立即登录</a>
                        <a id="btn2" style="background-color: #ea4909;" href="#">注册</a>
                    </div>
                </div>
            </div>
        </div>

        <script>
            // window.onclick = function (ev) {
            //     $(".picture").attr("style","display:none");
            // }

            $("#btn1").click(
                function () {
                    $("#mtk").css("background","rgba(0,0,0,0.5)");
                    $("#btn1").removeAttr("href");
                    $("#btn2").removeAttr("href");
                    // $(".picture").toggle("fast");
                    $("#mtk_nr").attr("style","display:block");
                }
            )


        </script>
    </body>
</html>